<?php

class filteringbadwords{

//include_once ("../db_connect.php"); // Connect to the database
function filterbadwords($str) 
{
include_once ("../db_connect.php"); // Connect to the database
	$bawal = Array();
	$bawal = explode(' ', $str); 
	
	
	
	$sql = mysql_query("SELECT * FROM tablebadwords");
	while ($row = mysql_fetch_array($sql))
	{
	$badka[ ] = $row["forbidden"];
	}	
	
	for($v = 0; $v < count($bawal); $v++ )
	{
		for($x=0; $x < count($badka); $x++)
		{
			if($bawal[$v] == $badka[$x])
			{
				return true;		
			}
		}
	}//end of the loop
}//end function

  


}//end of the class
?>